package com.betterjr.modules.account.entity;

import org.springframework.beans.BeanUtils;

/**
 * 
 * @ClassName: CustOperatorInfoExtend 
 * @Description: 查询当前操作员，扩展当前操作员的角色类型和企业角色 
 * @author xuyp
 * @date 2017年11月27日 下午2:16:18 
 *
 */
public class CustOperatorInfoExtend extends CustOperatorInfo {

    /** 
     * @Fields serialVersionUID :  
     */
    private static final long serialVersionUID = -5379025890150406372L;

    /**
     * 0:经办员  OPERATOR_USER
     * 1:复核员  OPERATOR_CHECKER
     * 2:审批员  OPERATOR_ADUIT
     * 3:管理员 OPERATOR_ADMIN
     */
    private String roleType;

    /**
     * 核心企业CORE_USER                0
     * 保理公司FACTOR_USER              1
     * 前海拜特平台PLATFORM_USER          2
     * 经销商客户SELLER_USER             3
     * 供应商客户SUPPLIER_USER           4
     */
    private String companyType;

    public CustOperatorInfoExtend() {
        super();

    }

    public CustOperatorInfoExtend(CustOperatorInfo info) {
        try {
            BeanUtils.copyProperties(info, this);
        }
        catch (Exception e) {

            this.setId(info.getId());
            this.setName(info.getName());
            this.setAddress(info.getAddress());
            this.setCustList(info.getCustList());
            this.setRuleList(info.getRuleList());
            this.setNickName(info.getNickName());
        }
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = super.hashCode();
        result = prime * result + ((companyType == null) ? 0 : companyType.hashCode());
        result = prime * result + ((roleType == null) ? 0 : roleType.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!super.equals(obj)) {
            return false;
        }
        if (!(obj instanceof CustOperatorInfoExtend)) {
            return false;
        }
        CustOperatorInfoExtend other = (CustOperatorInfoExtend) obj;
        if (companyType == null) {
            if (other.companyType != null) {
                return false;
            }
        } else if (!companyType.equals(other.companyType)) {
            return false;
        }
        if (roleType == null) {
            if (other.roleType != null) {
                return false;
            }
        } else if (!roleType.equals(other.roleType)) {
            return false;
        }
        return true;
    }

    public String getRoleType() {
        return roleType;
    }

    public void setRoleType(String roleType) {
        this.roleType = roleType;
    }

    public String getCompanyType() {
        return companyType;
    }

    public void setCompanyType(String companyType) {
        this.companyType = companyType;
    }

}
